package cn.cvs.dao;

import cn.cvs.pojo.Record;
import cn.cvs.pojo.Supplier;
import cn.cvs.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface SysUserMapper {
    /**
     * 统计用户数量的方法
     */
    int count();

    List<SysUser> getUserList();

    List<SysUser> getUsersByRealName(String realName);

    List<SysUser> getUserListByPojo(SysUser sysUser);

    List<SysUser> getUserListByMap(Map<String, Object> userMap);

    List<SysUser> getUserListByParams(@Param("realName") String realName, @Param("roleId") int roleId);

    List<SysUser> getUserListWithRoleName(SysUser sysUser);

    List<SysUser> getUserListByRoleId(@Param("roleId") Integer roleId);

    List<SysUser> getUserAndAddressesByUserId(@Param("userId") Integer userId);

    int add(SysUser user);

    int modify(SysUser user);

    int updatePwd(@Param("id") Integer id, @Param("password") String pwd);

    int deleteUserById(@Param("id") Integer id);

    List<Record> show(Record record);

    List<Record> resultShow(Record record);

    List<Record> assoctionw(Record record);

    List<Supplier> collection1(@Param("id") Integer id);


    int add1(Supplier user);

    int modify2(Supplier user);

    int deleteUserById3(@Param("id") Integer id);

    /**
     * 查询用户列表
     */
    public List<SysUser> selectList(@Param("realName") String realName, @Param("roleId") Integer roleId);

    /**
     * ch03-3
     *
     * @param realName
     * @param roleId
     * @return
     */
    public List<SysUser> selectList2(@Param("realName") String realName, @Param("roleId") Integer roleId);

    /**
     * ch03-4
     */
    public List<SysUser> selectList4(@Param("realName") String realName, @Param("roleId") Integer roleId);

    /**
     * ch03-5
     */
    public List<SysUser> selectListByChoose(@Param("realName") String realName, @Param("roleId") Integer roleId, @Param("account") String account
            , @Param("createdTime") Date createdTime);

    /**
     * ch03-6
     */
    public List<SysUser> getUserByRoleIdArray(Integer[] roleIds);

    /**
     * ch03-7
     */
    public List<SysUser> getUserByRoleIdList(List<Integer> roleList);

    /**
     * ch03-8
     */
    public List<SysUser> getUserByRoleIdMap(Map<String, Object> roleMap);

    /**
     * ch03-9
     */
    public int update(SysUser sysUser);

    /**
     * ch03-10
     */
    public int update2(SysUser sysUser);

    /**
     * ch03-11
     */
    public List<SysUser> selectList11(@Param("realName") String realName, @Param("roleId") Integer roleId);

    /**
     * ch03-12
     */
    public int update12(SysUser sysUser);

    /**
     * ch03-13
     */
    public List<SysUser> selectPageList(@Param("realName") String realName, @Param("roleId") Integer roleId,
                                        @Param("pageBegin") Integer pageBegin, @Param("pageSize") Integer pageSize);

    /**
     * ch03-上机-1
     */
    List<Record> selectTest1(@Param("supplierId") Integer supplierId, @Param("payStatus") Integer payStatus, @Param("goodsName") String goodsName);

    /**
     * ch03-上机-2
     */
    List<Supplier> selectTest2(@Param("supCode") String supCode, @Param("supName") String supName);

    /**
     * ch03-上机-3
     */
    List<Supplier> selectTest3(@Param("supName") String supName, @Param("supCode") String supCode, @Param("supContact") String supContact, @Param("createdTime") Date createdTime);

    /**
     * ch03-上机-4
     */
    List<Record> selectForTest4(Integer[] id);

    List<Record> selectForTest4_2(List<Integer> roleList);

    /**
     * ch03-上机-5
     */
    List<Record> selectMap(Map<String, Object> recordId);

    /**
     * ch03-上机-6
     */
    int updateSup(Supplier supplier);

    /**
     * ch03-上机-7
     */
    int updateSup2(Supplier supplier);

    /**
     * ch03-上机-8
     */
    List<Supplier> selectListFy(@Param("pageBegin") Integer pageBegin, @Param("pageSize") Integer pageSize);

    /**
     * ch03-上机-9
     */
    List<Record> selectListFy2(@Param("pageBegin") Integer pageBegin, @Param("pageSize") Integer pageSize);
}
